A Transformation-Based Implementation of Lightweight Nested Functions
نویسندگان
چکیده
The SC language system has been developed to provide a transformation-based language extension scheme for SC languages (extended/plain C languages with an S-expression based syntax). Using this system, many flexible extensions to the C language can be implemented by transformation rules over S-expressions at low cost mainly because of the pre-existing Common Lisp capabilities for manipulating S-expressions. This paper presents the LW-SC (LightWeight-SC) language as an important application of this system, which features nested functions (i.e., a function defined inside another function). Without returning from a function, the function can manipulate its caller’s local variables (or local variables of its indirect callers) by indirectly calling a nested function of its (indirect) caller. Thus, many high-level services with “stack walk” can be easily and elegantly implemented by using LW-SC as an intermediate language. Moreover, such services can be efficiently implemented because we design and implement LW-SC to provide “lightweight” nested functions by aggressively reducing the costs of creating and maintaining nested functions. The GNU C compiler also provides nested functions as an extension to C, but our sophisticated translator to standard C is more portable and efficient for occasional “stack walk”.
منابع مشابه
Lightweight 4x4 MDS Matrices for Hardware-Oriented Cryptographic Primitives
Linear diffusion layer is an important part of lightweight block ciphers and hash functions. This paper presents an efficient class of lightweight 4x4 MDS matrices such that the implementation cost of them and their corresponding inverses are equal. The main target of the paper is hardware oriented cryptographic primitives and the implementation cost is measured in terms of the required number ...
متن کاملتحلیل قابلیت اعتماد فازی سازهها با استفاده از روش دینامیکی انتقال پایدار امتدادی
In this paper, a new method is proposed for fuzzy structural reliability analysis; it considers epistemic uncertainty arising from the statistical ambiguity of random variables. The proposed method, namely, fuzzy dynamic-directional stability transformation method, includes two iterative loops. An internal algorithm performs the reliability analysis using the dynamic-directional stability trans...
متن کاملA new method for fuzzification of nested dummy variables by fuzzy clustering membership functions and its application in financial economy
In this study, the aim is to propose a new method for fuzzification of nested dummy variables. The fuzzification idea of dummy variables has been acquired from non-linear part of regime switching models in econometrics. In these models, the concept of transfer functions is like the notion of fuzzy membership functions, but no principle or linguistic sentence have been used for inputs. Consequen...
متن کاملNumerical Solution of the Lane-Emden Equation Based on DE Transformation via Sinc Collocation Method
In this paper, numerical solution of general Lane-Emden equation via collocation method based on Double Exponential DE transformation is considered. The method converts equation to the nonlinear Volterra integral equation. Numerical examples show the accuracy of the method. Also, some remarks with respect to run-time, computational cost and implementation are discussed.
متن کاملLightweight Lexical Closures for Legitimate Execution Stack Access
We propose a new language concept called “L-closures” for a running program to legitimately inspect/modify the contents of its execution stack. L-closures are lightweight lexical closures created by evaluating nested function definitions. A lexical closure can access the lexicallyscoped variables in the creation-time environment and indirect calls to it provide legitimate stack access. By using...
متن کامل